<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>11-表单按钮点击禁用及重新赋值</title>
	</head>
	<body>
		<form action="#" method="post">
			<label for="username"><input value="张学友" id="username" type="text" name="username"></label>
			<input type="submit" value="提交" id="btn">
		</form>
		<script type="text/javascript">
			var btn = document.getElementById('btn');
			var userobj = document.getElementById('username');
			btn.onclick = function(){
				//alert('abc');
				userobj.value = '李宝莉';
				//按钮禁用
				this.disabled = true;
			}
		</script>
	</body>
</html>
